﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Reflection;

namespace Devpad_IDE.Dialogs.Help
{
    /// <summary>
    /// Interaction logic for AboutDialog.xaml
    /// </summary>
    public partial class AboutDialog : Window
    {
        public AboutDialog()
        {
            InitializeComponent();
        }

        Assembly app = Assembly.GetExecutingAssembly();

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)app.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0];
            
            NameTextBlock.Text = Application.Current.MainWindow.GetType().Assembly.GetName().Name;
            VersionTextBlock.Text = "Version: " + app.GetName().Version.Major.ToString() + "." + app.GetName().Version.Minor.ToString() + "." + app.GetName().Version.Build.ToString();
            CopyrightTextBlock.Text = copyright.Copyright;
        }
    }
}